package org.smart4j.chapter4;

public class HelloProxy implements Hello{
    private Hello hello;
    public HelloProxy(){
        hello = new HelloImpl();
    }

    @Override
    public void say(String name) {
        before();
        hello.say(name);
        after();
    }

    private void before(){
        System.out.println("before");
    }

    private void after(){
        System.out.println("after");
    }

    public static void main(String[] args) {
        Hello hello = new HelloProxy();
        hello.say("bobo");
    }
}
